package com.jm.entity;
// Generated 2018-1-17 21:56:33 by Hibernate Tools 5.2.3.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * User generated by hbm2java
 */
@Entity
@Table(name = "user", catalog = "wxjm")
public class User implements java.io.Serializable {

	private Long userid;
	private Agenttype agenttype;
	private Area area;
	private String name;
	private String phone;
	private String idnumber;
	private String homeaddress;
	private String province;
	private String city;
	private String county;
	private String wechat;
	private String email;
	private String headicon;
	private String identifyicon;
	private String account;
	private String password;
	private Integer isauthorize;
	private Date authorizestart;
	private Date authorizeend;
	private String authorizenumber;
	private String authorizeimg;
	private long authorizedpersonid;
	private String agenttypename;
	private String lifepic;
	private Date createtime;
	private Integer canupgradelevel;
	private Integer examinelevelstatue;
	private Set<Order> orders = new HashSet<Order>(0);
	private Set<Userstock> userstocks = new HashSet<Userstock>(0);
	private Set<Useraddress> useraddresses = new HashSet<Useraddress>(0);

	public User() {
	}

	public User(String name, String phone, String idnumber, String wechat, String identifyicon, long authorizedpersonid,
			String lifepic) {
		this.name = name;
		this.phone = phone;
		this.idnumber = idnumber;
		this.wechat = wechat;
		this.identifyicon = identifyicon;
		this.authorizedpersonid = authorizedpersonid;
		this.lifepic = lifepic;
	}

	public User(Agenttype agenttype, Area area, String name, String phone, String idnumber, String homeaddress,
			String province, String city, String county, String wechat, String email, String headicon,
			String identifyicon, String account, String password, Integer isauthorize, Date authorizestart,
			Date authorizeend, String authorizenumber, String authorizeimg, long authorizedpersonid,
			String agenttypename, String lifepic, Date createtime, Integer canupgradelevel, Integer examinelevelstatue,
			Set<Order> orders, Set<Userstock> userstocks, Set<Useraddress> useraddresses) {
		this.agenttype = agenttype;
		this.area = area;
		this.name = name;
		this.phone = phone;
		this.idnumber = idnumber;
		this.homeaddress = homeaddress;
		this.province = province;
		this.city = city;
		this.county = county;
		this.wechat = wechat;
		this.email = email;
		this.headicon = headicon;
		this.identifyicon = identifyicon;
		this.account = account;
		this.password = password;
		this.isauthorize = isauthorize;
		this.authorizestart = authorizestart;
		this.authorizeend = authorizeend;
		this.authorizenumber = authorizenumber;
		this.authorizeimg = authorizeimg;
		this.authorizedpersonid = authorizedpersonid;
		this.agenttypename = agenttypename;
		this.lifepic = lifepic;
		this.createtime = createtime;
		this.canupgradelevel = canupgradelevel;
		this.examinelevelstatue = examinelevelstatue;
		this.orders = orders;
		this.userstocks = userstocks;
		this.useraddresses = useraddresses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "userid", unique = true, nullable = false)
	public Long getUserid() {
		return this.userid;
	}

	public void setUserid(Long userid) {
		this.userid = userid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "typeid")
	public Agenttype getAgenttype() {
		return this.agenttype;
	}

	public void setAgenttype(Agenttype agenttype) {
		this.agenttype = agenttype;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "areaid")
	public Area getArea() {
		return this.area;
	}

	public void setArea(Area area) {
		this.area = area;
	}

	@Column(name = "name", nullable = false)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "phone", nullable = false)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "idnumber", nullable = false)
	public String getIdnumber() {
		return this.idnumber;
	}

	public void setIdnumber(String idnumber) {
		this.idnumber = idnumber;
	}

	@Column(name = "homeaddress")
	public String getHomeaddress() {
		return this.homeaddress;
	}

	public void setHomeaddress(String homeaddress) {
		this.homeaddress = homeaddress;
	}

	@Column(name = "province")
	public String getProvince() {
		return this.province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	@Column(name = "city")
	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Column(name = "county")
	public String getCounty() {
		return this.county;
	}

	public void setCounty(String county) {
		this.county = county;
	}

	@Column(name = "wechat", nullable = false)
	public String getWechat() {
		return this.wechat;
	}

	public void setWechat(String wechat) {
		this.wechat = wechat;
	}

	@Column(name = "email")
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "headicon")
	public String getHeadicon() {
		return this.headicon;
	}

	public void setHeadicon(String headicon) {
		this.headicon = headicon;
	}

	@Column(name = "identifyicon", nullable = false)
	public String getIdentifyicon() {
		return this.identifyicon;
	}

	public void setIdentifyicon(String identifyicon) {
		this.identifyicon = identifyicon;
	}

	@Column(name = "account")
	public String getAccount() {
		return this.account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	@Column(name = "password")
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "isauthorize")
	public Integer getIsauthorize() {
		return this.isauthorize;
	}

	public void setIsauthorize(Integer isauthorize) {
		this.isauthorize = isauthorize;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "authorizestart", length = 10)
	public Date getAuthorizestart() {
		return this.authorizestart;
	}

	public void setAuthorizestart(Date authorizestart) {
		this.authorizestart = authorizestart;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "authorizeend", length = 10)
	public Date getAuthorizeend() {
		return this.authorizeend;
	}

	public void setAuthorizeend(Date authorizeend) {
		this.authorizeend = authorizeend;
	}

	@Column(name = "authorizenumber")
	public String getAuthorizenumber() {
		return this.authorizenumber;
	}

	public void setAuthorizenumber(String authorizenumber) {
		this.authorizenumber = authorizenumber;
	}

	@Column(name = "authorizeimg")
	public String getAuthorizeimg() {
		return this.authorizeimg;
	}

	public void setAuthorizeimg(String authorizeimg) {
		this.authorizeimg = authorizeimg;
	}

	@Column(name = "authorizedpersonid", nullable = false)
	public long getAuthorizedpersonid() {
		return this.authorizedpersonid;
	}

	public void setAuthorizedpersonid(long authorizedpersonid) {
		this.authorizedpersonid = authorizedpersonid;
	}

	@Column(name = "agenttypename")
	public String getAgenttypename() {
		return this.agenttypename;
	}

	public void setAgenttypename(String agenttypename) {
		this.agenttypename = agenttypename;
	}

	@Column(name = "lifepic", nullable = false)
	public String getLifepic() {
		return this.lifepic;
	}

	public void setLifepic(String lifepic) {
		this.lifepic = lifepic;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "createtime", length = 10)
	public Date getCreatetime() {
		return this.createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	@Column(name = "canupgradelevel")
	public Integer getCanupgradelevel() {
		return this.canupgradelevel;
	}

	public void setCanupgradelevel(Integer canupgradelevel) {
		this.canupgradelevel = canupgradelevel;
	}

	@Column(name = "examinelevelstatue")
	public Integer getExaminelevelstatue() {
		return this.examinelevelstatue;
	}

	public void setExaminelevelstatue(Integer examinelevelstatue) {
		this.examinelevelstatue = examinelevelstatue;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Order> getOrders() {
		return this.orders;
	}

	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}

	@OneToMany(fetch = FetchType.EAGER, mappedBy = "user")
	public Set<Userstock> getUserstocks() {
		return this.userstocks;
	}

	public void setUserstocks(Set<Userstock> userstocks) {
		this.userstocks = userstocks;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Useraddress> getUseraddresses() {
		return this.useraddresses;
	}

	public void setUseraddresses(Set<Useraddress> useraddresses) {
		this.useraddresses = useraddresses;
	}

}
